package com.ycy.analyzer.jp;

import com.atilika.kuromoji.ipadic.Token;
import com.atilika.kuromoji.ipadic.Tokenizer;

import java.util.List;

/**
 * @Author: ycy
 * @CreateDate: 2020/7/30 10:09
 */
public class Kuromoji {


  public static void main(String[] args) {

    display("中国");
    display("お寿司が食べたい。");
    display("観光スポット");
    display("ドミニカ共和国");
    display("日本経済新聞関西国際空港");
  }

  public static void display(String like) {
    Tokenizer tokenizer = new Tokenizer();
    List<Token> tokens = tokenizer.tokenize(like);
    for (Token token : tokens) {
      System.out.println(token.getSurface() + "\t" + token.getAllFeatures());
      System.out.println(token.getReading());
    }
  }

}
